package com.jiayan.controller;

import com.jiayan.service.FurnitureService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
@RequestMapping("/experience")
public class ExperienceController {
    @Resource
    private FurnitureService furnitureService;


    @RequestMapping("/list")
    public String Material(Model model,
                            @RequestParam(value = "pnum",defaultValue = "1") Integer pnum){//行为
        //TODO 1.调用service层查询首页数据的方法
//        Map<String, Object> list = furnitureService.list(pnum);
//        EbProduct detail = furnitureService.detail(1);
//        //TODO 2.绑定数据到model---数据
//        model.addAttribute("list",list);
////        System.out.println(list);
//        model.addAttribute("detail",detail);

        //TODO  3.返回View---html
        return "experience";
    }
}
